/**
 * @description 环境
 * @author 张航
 * @date 2020-03-18 12:48:29
 * @version V1.0.0
 */

/**
 * @functionName  getExplorer
 * @return {String} 当前浏览器名称
 * @description 获取当前运行浏览器
 * @author 张航
 * @date 2020-03-18 12:48:56
 * @version V1.0.0
 */
export const getExplorer = () => {
  const ua = window.navigator.userAgent
  const isExplorer = (exp) => {
    return ua.indexOf(exp) > -1
  }
  if (isExplorer('MSIE')) return 'IE'
  else if (isExplorer('Firefox')) return 'Firefox'
  else if (isExplorer('Chrome')) return 'Chrome'
  else if (isExplorer('Opera')) return 'Opera'
  else if (isExplorer('Safari')) return 'Safari'
}
